#Twisted Shootout
#Copyright (C) 2007  Han Dao
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.

#You can contact the author at wikipediankiba@gmail.com

import pygame

class EditCollide:
	def __init__(self,nav,sel):
		self.left = nav.left
		self.right = nav.right
		self.down = nav.down
		self.up = nav.up
		self.block = sel.block
		self.block2 = sel.block2
		self.wall1 = sel.wall1
		self.tunnel = sel.tunnel
		self.win = sel.win
		self.start = sel.start
		self.medickit = sel.medickit
		self.cache = sel.cache
	def arrow(self,key):
		if self.left.rect.colliderect(key):
			return 1
		elif self.right.rect.colliderect(key):
			return 2
		elif self.down.rect.colliderect(key):
			return 3
		elif self.up.rect.colliderect(key):
			return 4
		return False
	def value(self,key):
		if self.block.rect.colliderect(key):
			return 3
		elif self.wall1.rect.colliderect(key):
			return 2
		elif self.block2.rect.colliderect(key):
			return 4
		elif self.tunnel.rect.colliderect(key):
			return 5
		elif self.win.rect.colliderect(key):
			return 7
		elif self.start.rect.colliderect(key):
			return 8
		elif self.medickit.rect.colliderect(key):
			return 9
		elif self.cache.rect.colliderect(key):
			return 10
		else:
			return False